<!DOCTYPE HTML>
<html>
<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <base href="http://clickmobile.com/" />
  <link rel="stylesheet" type="text/css" href="<?php echo $stylePath.'css/bootstrap.min.css' ;?>">
  <link rel="stylesheet" type="text/css" href="<?php echo $stylePath.'css/otherstyle.css';?>">
  <script type="text/javascript" src="<?php echo $stylePath.'js/jquery.min.js'; ?>"></script>
  <script type="text/javascript">
  	$(document).ready(function(){
  		var customeremail = "<?php echo $customerinfo['email']; ?>";
  		var customerbirthday = "<?php echo $customerinfo['birthday']; ?>";
  		var customerphone = "<?php echo $customerinfo['phone']; ?>";
  		var customername = "<?php echo $customerinfo['name']; ?>";
  		$("input#customer-email").val(customeremail);
  		$("input#customer-birthday").val(customerbirthday);
  		$("input#customer-name").val(customername);
  		$("input#customer-phone").val(customerphone);
  	})
  </script>   
</head>
<body>
  <div class="container well">
    <div class="row">
      <div class="span2">
      <div class="logo"></div>
      </div>
      <div class="span3 offset7">
        <div class="account">
          <div class="btn-group pull-right">
                <a class="btn btn-info" href="admin.php/account"><i class="icon-user icon-white"></i>Thông tin tài khoản</a>
                <a class="btn btn-info" href="admin.php/login/logout"><i class="icon-off icon-white"></i></a>
              </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="span12">
      <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </a>
                  <a class="brand" href="admin.php/home">Quản trị</a>
                  <div class="nav-collapse">
                    <ul class="nav">
                      <li class="divider-vertical"></li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Người dùng <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li><a href="admin.php/user">Danh sách</a></li>
                          <li class="divider"></li>
                          <li><a href="admin.php/user/add">Thêm mới</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sản phẩm <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li class="nav-header">Sản phẩm</li>                          
                          <li><a href="#">Danh mục</a></li>
                          <li><a href="#">Thêm mới</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Nhóm sản phẩm</li>
                          <li><a href="#">Nhóm sản phẩm</a></li>
                          <li><a href="#">Nhà sản xuất</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Thuộc tính</li>
                          <li><a href="#">Danh mục</a></li>                                                    
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                      
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Bán hàng <b class="caret"></b></a>
                        <ul class="dropdown-menu">                         
                          <li><a href="#">Đơn hàng</a></li>
                          <li class="divider"></li>                      
                          <li><a href="#">Phương thức thanh toán</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mở rộng <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li class="nav-header">Thông tin</li>                          
                          <li><a href="#">Trang thông tin</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Mở rộng</li>
                          <li><a href="#">SlideShow</a></li>
                          <li><a href="#">Banner</a></li>                         
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Báo cáo - thống kê <b class="caret"></b></a>
                        <ul class="dropdown-menu">                        
                          <li><a href="#">Xuất dữ liệu</a></li>
                          <li class="divider"></li>
                          <li><a href="#">Báo cáo</a></li>
                          <li class="divider"></li>
                          <li><a href="#">Biểu đồ</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Hệ thống <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            

                    </ul>
                  </div><!-- /.nav-collapse -->
                </div>
              </div><!-- /navbar-inner -->
            </div>
      </div>
    </div>
  	<div class="row">
  		<div class="span2 side-bar">
        <ul class="nav nav-list">
          <li class="nav-header">Quản trị người dùng</li>
          <li><a href="admin.php/user">Danh sách</a></li>
          <li><a href="admin.php/user/add">Thêm mới</a></li>
        </ul>
  		</div>
      <div class="span9 pull-right main-content">
      	<div class="filter">
          <form class="form-inline" method="post">
            <input type="text" class="" name="customer-email"  id="customer-email" disabled>            	
            <input type="text" class="" placeholder="Tên" name="customer-name"  id="customer-name" >
            <input type="date" class="" placeholder="Sinh nhật" name="customer-birthday"  id="customer-birthday" >
            <input type="text" style="width:150px" placeholder="Điện thoại" name="customer-phone"  id="customer-phone" >
            <button type="submit" style="width:60px" class="btn pull-right btn-success" id="action-update">Lưu</button>          
          </form>
        </div>
        <table class="table table-bordered table-hover">
		    <thead>
		      <tr class="info">
		        <th colspan="2"></th>
		        <th>Người nhận</th>
		        <th style="max-width:50px">Điện thoại</th>
		        <th style="max-width:50px">Địa chỉ</th>

		      </tr>
		    </thead>
		    <tbody>
        		<?php 
        			foreach ($customeraddress as $value) 
        			{
			          echo '<tr>';
			          echo '<td style="width:5px"><input type="checkbox" id="checkbox'.$value['customer_address_id'].'"></td>';
			          echo '<td style="width:5px"><a class="btn btn-small btn-danger" title="Xóa" id="delete'.$value['customer_address_id'].'"><i class="icon-trash icon-white"></i></a>'; 
			          echo '<td style="width:100px">'.$value['receiver_name'].'</td>';			          
			          echo '<td style="width:100px">'.$value['phone'].'</td>';
			          echo '<td >'.$value['address'].'</td>';
        			}
        		?>
		    </tbody>
		</table>
		<div class="control-list">
          <img src="<?php echo $stylePath.'/img/arrow_ltr.png' ?>" style="float:left">
          <div class="btn-group" style="float:left; padding-right:5px">
            <button class="btn btn-small btn-success" id="checkAll"><i class="icon-ok icon-white"></i></button>
            <button class="btn btn-small btn-success" id="uncheckAll"><i class="icon-remove icon-white"></i></button>
          </div>
          <div class="btn-group" style="float:left; padding-right:5px">
            <button class="btn btn-small btn-danger" id="deleteAll"><i class="icon-trash icon-white"></i> Xóa</button>
          </div>
          <a class="btn btn-small btn-info" href="#addAddress" data-toggle="modal"><i class="icon-plus icon-white"></i> Thêm mới</a>
	        <div class="modal hide fade" id="addAddress">
	          <div class="modal-header" style="background-color: #BD362F;">
	            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	            <h3>Địa chỉ giao hàng</h3>
	          </div>
	          <form class="form-horizontal" method="post">
	            <div class="modal-body">
	              <div class="control-group">
	                <label class="control-label" for="Receiver">Người nhận:</label>
	                <div class="controls ">
	                  <input class="input-xlarge" type="text" id="Receiver" name="add-receiver">              
	                </div>             
	              </div> 
	              <div class="control-group">
	                <label class="control-label" for="Phone">Điện thoại:</label>
	                <div class="controls">
	                  <input class="input-xlarge" type="text" id="Phone" name="add-phone" >
	                </div>
	              </div>                
	              <div class="control-group">
	                <label class="control-label" for="Address">Địa chỉ</label>
	                <div class="controls">
	                  <textarea rows="5" style="width:270px" name="add-address"></textarea>
	                </div>
	              </div>                  
	            </div>
	            <div class="modal-footer" style="background-color: #BD362F;"  >
	              <button type="submit" class="btn btn-danger" >Lưu</button>
	              <button class="btn" data-dismiss="modal" aria-hidden="true">Hủy</button>
	            </div>      
	          </form>
	        </div>
        </div>
      </div>
  	</div>
  	<div class="row">
  		<div class="span12 footer">
	        <a href="admin.php"> Trang quản trị </a> | <a href="index.php"> Trang người dùng </a> | <a href="#"> Trợ giúp kĩ thuật </a>
	        <div class="pull-right">
	        <a href="#">© 2012 ClickMobile</a>  
          <img src="">
        </div>
  		</div>
  	</div>   
  </div>
<script type="text/javascript" src="<?php echo $stylePath.'js/jquery.min.js'; ?>"></script>
<script type="text/javascript" src="<?php echo $stylePath.'js/bootstrap.min.js';?>"></script> 
<script type="text/javascript">
    $('#checkAll').click(function(){
      $('input[id^="checkbox"]').attr('checked',true);
    });
    $('#uncheckAll').click(function(){
      $('input[id^="checkbox"]').attr('checked',false);
    });
	$("a[id^='delete']").click(function(){
      var checkedid = $(this).attr('id').substring(6)+',';
      $.ajax({
        url: 'http://clickmobile.com/admin.php/user/edit/<?php echo $customerinfo["customer_id"]; ?>',
        type:'POST',
        data:'checkedid='+checkedid,
        asynce :true,
        success: function(result){
        	location.reload();
        }
      });  
    })
    $('#deleteAll').click(function(){
      var checkedid = '';
      $('input[id^="checkbox"]').each(function(){
        if(this.checked){
          var val = $(this).attr('id');
          checkedid += val.substring(8)+',' ;
        }
      })
      $.ajax({
        url: 'http://clickmobile.com/admin.php/user/edit/<?php echo $customerinfo["customer_id"]; ?>',
        type:'POST',
        data:'checkedid='+checkedid,
        asynce :true,
        success: function(result){
        	location.reload();
        }
      });
    })              
</script>
</body>
</html>
